package com.cysyz.mylib.barcode;

/**
 * Created by cuiyong on 15/6/1.
 */
public class BarcodeMaker {

//    private IFileSaveTool fileSaveTool;
//
//    public BarcodeMaker(String absoluteSaveDirPrefixPath, String urlPathPrefix) {
//        fileSaveTool = new FileSaveToolImpl(absoluteSaveDirPrefixPath, urlPathPrefix);
//    }
//
//    public String make (String content, String path, int width, int height) {
//
//        MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
//
//        Map hints = new HashMap();
//        hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
//        BitMatrix bitMatrix = null;
//        try {
//            bitMatrix = multiFormatWriter.encode(content, BarcodeFormat.QR_CODE, width, height, hints);
//            ByteArrayOutputStream baos = new ByteArrayOutputStream();
//
//            MatrixToImageWriter.writeToStream(bitMatrix, "jpg", baos);
//            return fileSaveTool.saveFile(baos.toByteArray(), "", path);
//
//        } catch (WriterException | IOException e) {
//            throw new RuntimeException(e);
//        }
//    }
}
